/**
 * 员工月度绩效申报
 */
app.controller('btnCtrl', ['$scope', '$http', BtnController]);
function BtnController($scope, $http){
    console.log('------$scope.menuId1-----', $scope.menuId);
    console.log('------$scope.buttonArr1-----', $scope.buttonArr);


    $scope.bindBtn = function(event) {
        var datas = $scope.getSelectedRows();
        switch(event){
            case 'event-to-add':
            {
                window.top.add_tab('员工月度绩效申报 - 新增', '/web/base/tbUserMonthPerformanceReport/toAdd');
                break;
            }
            case 'event-to-edit'://编辑
            {
                if(datas.length == 0) {
                    layer.alert('尚未选中数据');
                } else if(datas.length > 1) {
                    layer.alert('只能选中一行数据');
                } else {
                    window.top.add_tab('员工月度绩效申报('+datas[0].bid+') - 编辑', '/web/base/tbUserMonthPerformanceReport/toEdit?bid=' + datas[0].bid);
                }
                break;
            }
            case 'LAYTABLE_EXPORT_DATA':
            {
                $scope.doExport('/api/inter/tbUserMonthPerformanceReport/export');
                break;
            }

        };
    }
}


//表格双击
app.controller('dbClickCtrl', ['$scope', '$http', DbClickController]);
function DbClickController($scope, $http){
    $scope.doubleClick = function(data) {
        console.log('------data-----', data);
        window.top.add_tab('员工月度绩效申报('+data.bid+') - 编辑', '/web/base/tbUserMonthPerformanceReport/toEdit?bid=' + data.bid);
    }
}

